$(function () {
     $.ajax({
          type: 'get',
          url: '/cart/queryCart',
          dataType: 'json',
          success: function (res) {
              if(res.error) {
                  location.href="./login.html"
              }
              console.log( res );
              var obj={
                  list:res
              }
           $(".cart-list").html(template("tmp",obj))
          }
      })
})